ArimaMary's artsy microblog. Started as an archive of my art Tumblr sideblog. https://art.arimamary.net/
  • CSS 54.2%
  • HTML 35.8%
  • JavaScript 4.2%
  • Nunjucks 3.9%
  • Python 1.9%
Find a file
2026-04-19 13:04:17 -05:00
.vscode successfully set up sidebar! 2026-03-28 19:35:34 -05:00
_site edited microblog.js, base.njk; added axion depencies to package.json, bunch of art from my old tumblr blog 2026-04-18 23:37:12 -05:00
netlify/functions edited microblog.js, base.njk; added axion depencies to package.json, bunch of art from my old tumblr blog 2026-04-18 23:37:12 -05:00
node_modules edited microblog.js, base.njk; added axion depencies to package.json, bunch of art from my old tumblr blog 2026-04-18 23:37:12 -05:00
src edited index.md 2026-04-19 13:04:17 -05:00
.eleventy.js edited .eleventy.js, index.md, base.njk, flex.css, pages.json; deleted pinned folder, posts folder; added buttons to sidebar; renamed pages folder to nav; deleted some buttons 2026-04-17 20:45:35 -05:00
.gitignore created .env.micropub, config.js, media.js; edited .gitignore, .netlify.toml 2026-03-30 23:24:38 -05:00
.netlify.toml edited .netlify.toml 2026-04-18 13:02:05 -05:00
generate_rss.py deleted .env.micropub, config.js, media.js; edited netlify.toml, base.njk; created generate_rss.py 2026-04-14 21:37:13 -05:00
LICENSE edited .eleventy.js, .netlify.toml, package.json, and micrpub.js; added media.js, config.js in netlify folder; renamed public to _site 2026-04-17 13:07:44 -05:00
package-lock.json edited microblog.js, base.njk; added axion depencies to package.json, bunch of art from my old tumblr blog 2026-04-18 23:37:12 -05:00
package.json edited microblog.js, base.njk; added axion depencies to package.json, bunch of art from my old tumblr blog 2026-04-18 23:37:12 -05:00
README.MD successfully set up sidebar! 2026-03-28 19:35:34 -05:00

Instructions

Part 1: Install Eleventy

  1. Open terminal in VSCode.
  2. Open terminal
  3. Type npm init
  4. Type npm install @11ty/eleventy
  5. Go to package.json and locate the scripts element
  6. Replace "test": "echo \"Error: no test specified\" && exit 1" with "start": "eleventy --serve", "build": "eleventy"
    • Rewrites the command that enables launching a local server with hot reload (automatic updates to live server while making changes to the code)
  7. In the root folder, create .eleventy.js
    • helps to customize many elements of the repo such as input and output folders.
  8. In .eleventy.js type module.exports = function (eleventyConfig){ return { dir: { input: "src", output: "public", }, }; }; which makes the src folder the one where the codes is edited and public folder the one that is deployed.

Part 2: Create a Site

  1. In root directory, create a folder called src. This will be a directory.
  2. Inside src, create a file called index.html.
  3. Add some boilerplate HTML content.
  4. Back in the command line, run the start command npm start. Click the local host:8000 link that appears.
  5. Return to the code editor. Inside the src folder, create the file css/style.css. This will create a folder with a stylesheet.
  6. Inside style.css add some boilerplate CSS of choice.
  7. Go back to index.html and a link to the stylesheet in the head element like so: <link rel="stylesheet" href="css/style.css">. While this would have applied the stylesheet, at the time of the video tutorial and writing this, Eleventy requires one more step.
  8. Go to .eleventy.js (the config file) and add right below module.exports = function (eleventyConfig){ add the following two lines eleventyConfig.addPassthroughCopy("./src/css/"); eleventyConfig.addWatchTarget("./src/css/");. If the file doesn't update, killing the terminal and starting up another server could fix it.

Part 3: Templates

  1. In the src directory, create another directory called _includes/base.njk which will hold all website files. 16.5 If Nunjucks Emmet isn't working on your editor, download a Nunjucks extension and on the settings.json add code. You can also try changing the language the editor autodetects to HTML instead. Check this tip.
  2. On base.njk, add some boiler plate HTML. Link the stylesheet on the head element like before. Inside the body tags, the following:

<header> <h1>{{ title }}</h1> </header> <main> <article> {{ content | safe }} </article> </main> <footer> <p>&copy; 2021 Arima Mary</p> </footer>. Additionally, change the text inside the title tag inside the head tag for {{ title }}.

  1. Go to index.html and change it's extension to Mardown such that the file becomes index.md. Then, add the following at the top of the file,

---

title: Base Eleventy Project

layout: base.njk

---

and replace the rest of the content inside the content inside the body tag with Markdown syntax. This is YAML frontmatter. The first line adds a title to the page and the second applies the layout described in base.njk plus stylesheet.

  1. In the src directory, create the folder pages and the file page.njk separately.

  2. Inside page.njk, paste the following: --- layout: base.njk ---

{{ content | safe }}

  1. Inside pages directory, create the files page-one.md and page-two.md.

  2. In both pages, add the following content:

--- title: Page (One/Two) ---

This is the (first/second) page

  1. To add a layout to all files without repeating the frontmatter in the pages directory, create a file called pages.json and add the following:

{ "layout": "page.njk", "tags": "pages" }

The tags property allows to use the directory as a collection.

  1. Back in index.md, add the following to display the pages collection as a list.

{% for page in collections.pages %} - [{{ page.data.title }}]({{ page.url }}) {%- endfor %}

This uses a combination of Markdown syntax link for link: {{ page.data.title }} and URL: {{ page.url }}

If the live page doesn't update. Try killing it and restarting using npm start in the terminal.

Extra: How to add an image.

  1. Inside the src directory, create a folder called images and add a stock image.

  2. Inside inside.md add the Markdown syntax to display and image like so, ![text](URL).

  3. In .eleventy.js after the addWatchTarget for src/css folder add,

eleventyConfig.addPassthroughCopy("./src/images/");

This should display your image of choice. If it doesn't, check the public folder to see if the image folder was created inside the src directory. If not, kill the serve and restart 11ty with npm start. Hope it works!