Skip to content

An eleventy starter project for photographers or artists to showcase their work and blog.

License

Notifications You must be signed in to change notification settings

sira313/TWCARTY

Repository files navigation

TWCARTY

An eleventy starter project for photographers or artists to showcase their work and blog.

twcarty.netlify.app
apoxi.cam

Powered by:

EleventyTailwindCSSDaisyUI


Features

  • Clean, simple, and responsive design
  • Auto-minifies HTML, CSS, and JS
  • Lazy loading of images
  • DaisyUI integration
  • Carousel post gallery

Basic Info

Required skills

  • Git
  • NPM
  • Html and css (opsional)

How to

Clone the repository

git clone https://github.com/sira313/twcarty

Install PNPM globally

npm install -g pnpm

Install the project dependencies

pnpm install

Run the project locally

pnpm build && pnpm serve

If you wanted to modify the style, you may need to run this command below in split terminal

pnpm watch:css

Directory Structure

❯ tree
src
├── asset
│   ├── index
│   │   ├── cover.webp
│   │   ├── favicon.ico
│   │   └── profile.webp
│   ├── js
│   │   └── lazysizes.min.js
│   └── photos
│       ├── thumbnail
│       │   └── warkop.webp
│       └── warkop.webp
├── blog
│   ├── eleventy-card.md
│   └── photos-license.md
├── _data
│   ├── nav.json
│   ├── nav-mobile.json
│   └── sosmed.json
├── _includes
│   ├── footer
│   │   ├── footer-credit.html
│   │   └── footer-sosmed.html
│   ├── index
│   │   ├── profile.html
│   │   └── recent.html
│   ├── main-layout
│   │   ├── base.html
│   │   ├── index.html
│   │   ├── post-blog.html
│   │   └── post-photos.html
│   ├── post
│   │   ├── comment.html
│   │   └── share.html
│   └── search
│       ├── search-global.html
│       └── search.html
├── index.md
├── _pages
│   ├── 404.html
│   ├── blog.html
│   ├── photos.html
│   ├── search-data.html
│   ├── search.html
│   ├── tag-blog.html
│   ├── tag-photos.html
│   └── theme.html
├── photos
│   ├── Toko.md
│   └── warkop.md
└── styles.css

Settings

  • Language: Update the language setting in src/_includes/main/base.html:
    <html lang="en">
  • Root URL: Set your root URL in .eleventy.js:
    // Root URL for the share button
    eleventyConfig.addGlobalData("rootURL", "https://twcarty.netlify.app");

Social media buttons

Set your social media in src/_data/sosmed.json Use svg icon you can download from anywhere like feathericons or create your own with inkscape

Menu

The project includes two default menus for post indexing:

  • Photos
  • Blog

To add another menu, follow this tutorial. Don’t forget to update the collection in .eleventy.js:

// Collections
const collectionConfigs = [
  { name: "posts", glob: "src/blog/**/*.md" },
  { name: "photos", glob: "src/photos/**/*.md" },
  { name: "recentPosts", glob: "src/blog/*.md", limit: 3 },
  { name: "recentPhotos", glob: "src/photos/*.md", limit: 6 }
];

Also, add your new menu in src/_data.

Layouts

There are three layouts in src/_includes/main:

Index Pages

All pages store in src/_pages. But the project includes three index pages:

Creating Posts

A script is available to automate post creation, so manual work is not necessary. Thanks to my friend.

To create a blog post in /blog:

pnpm mkpost -b "Your post title"

This will create a markdown file in /blog.

To create a photo post in /photos:

pnpm mkpost -p "Your post title"

Assets

All assets are stored in the /src/asset/ directory and referenced in the front matter.

Tips

For optimal image conversion to .webp, use Squoosh.

I tried using eleventy-img, but it didn’t quite fit my needs. Feel free to explore it yourself.

Like my work? Gimme a cup coffee 😉

PayPal