Coder Social home page Coder Social logo

mtsknn / mtsknn.fi Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 3.0 878 KB

My little personal website / blog. Eleventy + Preact + Tailwind CSS.

Home Page: https://mtsknn.fi

License: MIT License

JavaScript 84.22% CSS 13.60% Shell 0.88% Liquid 1.30%
11ty blog eleventy personal-blog personal-website pug tailwind tailwindcss preact

mtsknn.fi's Introduction

mtsknn.fi

My little personal website / blog. Visit it πŸ‘‰

  • 🎈 A static site, built on Eleventy.
  • βš› Layouts written with Preact and rendered to static HTML when the site is built (β†’ zero runtime JavaScript from the layouts).
  • 🌬 Styles written with Tailwind CSS. (Yelp, I'm still stuck on v1!)
  • πŸ’  Running on Netlify (for free!).
  • πŸ‘ Open source: MIT License.
    • ⚠ Content files (blog posts etc.) are not openly licensed. They are Β© me and reside in a separate, private Git repo.
    • This project doesn't aim to be a generic template for Eleventy sites, but it's open so anyone can learn from it.
    • I'm not looking for pull requests, but please do open an issue if you found a bug or have questions or comments!

Running locally

If you are not me

  1. Run npm install to install dependencies.
  2. Run git rm .gitmodules content/ and git mv _sample-content/ content/ to use the sample content as a starting point.
  3. Optional: run git commit -m 'Setup initial content' to commit the previous step's changes.
  4. Run npm start and open http://localhost:8080/.

If you are me

Hi me!

  1. npm install
  2. git submodule update --init
  3. cd content && git checkout master
  4. cd .. && npm start

The content that I have written is in a separate, private Git repo. It's private so that I can store drafts and scheduled posts there (and fix embarrassing typos and mistakes without anyone having to know about them afterwards!). Plus the content files are not openly licensed (they are Β© me).

Creating new content

  • Blog posts: content/blog/
  • Blog post drafts: content/blog/drafts/
  • Top-level pages: content/ + you probably want to update utils/navItems.js

Folder structure

  • πŸ“‚ _sample-content/: Sample content to get you started. See the "Running locally" section for how to use these files.
  • πŸ“‚ _site/: Development/production build created by running npm start/npm run build.
  • πŸ“‚ .github/workflows/
  • πŸ“‚ assets/
    • πŸ“„ css/main.css: Processed by Tailwind when running npm start or npm run build. The result is outputted to the _site/ folder.
    • πŸ“„ favicon/*: The files are copied as-is to the _site/ folder.
  • πŸ“‚ components/: Preact components, used by layout files (which are also Preact components).
  • πŸ“‚ content/: Eleventy's input directory. The default is the root folder, but having the input files (i.e. the content files) in their own folder makes things clearer.
  • πŸ“‚ data/: Eleventy's directory for global data files (the default is _data). All files are JavaScript data files and automatically available in content files (Markdown). Place stuff here instead of in utils/ if you need the stuff in content files (Markdown).
  • πŸ“‚ eleventy/: Eleventy's config files, required by the top-level config file (.eleventy.js).
  • πŸ“‚ layouts/: Eleventy's directory for includes (the default is _includes).
  • πŸ“‚ utils/: Utils, helpers and such. Place stuff here instead of in data/ if you don't need the stuff in content files (Markdown).
  • πŸ“„ .eleventy.js: Eleventy's config file.
  • πŸ“„ .eleventyignore: Eleventy's ignore file.
  • πŸ“„ .env.example: Example environment variables used to get most visited blog posts from Plausible Analytics.
    • If you don't use Plausible Analytics, you can ignore this file.
    • Otherwise you can copy and save this as .env to set local environment variables. You need to set the environment variables to Netlify too (or wherever you are hosting your site).
  • πŸ“„ .gitmodules: Specifies a Git submodule pointing to my private Git repo which contains all content. You don't need this unless you want to have a similar setup.
  • πŸ“„ netlify-setup.sh: A script needed in Netlify because the Git submodule points to a private Git repo. Blog post about this coming soonβ„’.
  • πŸ“„ netlify.toml: Build and redirection configurations for Netlify.

Deploying to production (Netlify)

  1. Run npm run build
  2. ???
  3. PROFIT!!

Heh, that's how it quite much feels since setting up the site on Netlify was so easy. I don't even remember what I did since Netlify did most of the job.

Just follow Netlify's good documentation and instructions. Deploying to Netlify is easy.

If you are dealing with Git submodules (hi me!), check out info about Git submodules on Netlify Docs.

License

MIT Β© Matias Kinnunen

Note that content files (blog posts etc.) are not openly licensed. They reside in a separate, private Git repo.

mtsknn.fi's People

Contributors

dependabot[bot] avatar mtsknn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.