Giter Club home page Giter Club logo

anna's Introduction

Anna

Test Workflow Netlify Status Go Reference GitHub Repo Stars

    ___
   /   |  ____  ____  ____ _
  / /| | / __ \/ __ \/ __ `/
 / ___ |/ / / / / / / /_/ /
/_/  |_/_/ /_/_/ /_/\__,_/

A static site generator in go

Inspired by Hugo and Saaru, this static site generator aims to take performance to the next level with parallel rendering, live reload and so much more, all in Go.

Pronounced: /ɐnːɐ/ which means rice 🍚 in Kannada

This project is a part of the ACM PESU-ECC's yearly AIEP program, and is maintained by Adhesh Athrey, Nathan Paul, Anirudh Sudhir, and Aditya Hegde

Detailed documentation for our SSG can be found here


Get Started

go run github.com/anna-ssg/[email protected]

Quick start

Contributing to Anna

If you have git installed, clone our repository and build against the latest commit

git clone github.com/anna-ssg/anna; cd anna
go build

Developer Guide

anna's People

Contributors

anirudhsudhir avatar polarhive avatar bwaklog avatar dedlad avatar navinshrinivas avatar

Stargazers

Raj Nandan Sharma avatar Nityananda Gohain avatar Achyuth Yogesh Sosale avatar Bocke avatar  avatar  avatar  avatar

Watchers

Lucian avatar  avatar  avatar  avatar

Forkers

dedlad acmpesuecc

anna's Issues

Follow go best practices

Best practices:

https://pkg.go.dev/about#best-practices

  • Has go.mod file
  • Redistributable license
  • Tagged version. When the go get command resolves modules by default it prioritizes tagged versions. When no tagged versions exist, go get looks up the latest known commit. Modules with tagged versions give importers more predictable builds. See semver and Keeping Your Modules Compatible for more information.
  • Stable version. Projects at v0 are assumed to be experimental. When a project reaches a stable version – major version v1 or higher – breaking changes must be done in a new major version. Stable versions give developers the confidence that breaking changes won’t occur when they upgrade a package to the latest minor version.

Guidelines on writing go style'd docs:

https://pkg.go.dev/about#documentation

It’s important to write a good summary of the package in the first sentence of the package comment. The go.dev site indexes the first sentence and displays it in search results.

  • Add go pkg badge to the README
  • Tag known bugs using godoc syntax
  • Let pkgsite generate documentation from source code. (Use long form comments)

meta: buildscript GitHub Actions

On every push to main: run a script that builds ssg and deploys /rendered to vercel

  • Quickly preview our site without having to run go run on a computer. Or when you're on the go (no pun intended) and want to see the progress made by other team-mates so far (at the main branch).
  • Make sure to add a robots.txt to the /static dir to tell search engines not to index our site is still in development.
  • Later, it evolves into a build script for deploying sites built with ssg with a one-click deploy button (Deploy to Vercel).

Enhancements

  • Add a Table of Contents section to each post with tests
  • Dynamic image resizing - Implemented using CSS in multiple themes
  • ⁠Recursively copy static content from ⁠ content/posts/dirname ⁠ to ⁠rendered/posts/dirname - Organise all pictures associated with a post in a particular folder and copy the images to rendered/posts/dirname

Bootstrap site dir

Currently we assume a user has a site folder locally with the pre-requisite layout partial files and a valid config.yml

If missing, it throws an error. Either generate a site dir or use go-git to clone the site dir from the base repo

Anna theme management

Proof of concept:

  • Store all themes in a separate repo in the anna-org
  • Create a themes.txt which stores the links of themes, on PR updates to this file, a Github Action is run which gets the themes and zips it as a release individually
  • Should follow a certain set of guidelines (fonts in static/, etc)
  • Anna must fetch themes from this remote

Use new namespace: anna

Tentatively we plan on calling our ssg anna: pronounced /ɐnːɐ/ which means rice in Kannada 🍚.

  • rename the repo slug to anna
  • update go.mod
  • update the ci.yaml
  • update title and fix footer wording
  • cleanup for v0.1 release call it grain 0.1 maybe?
  • expose site to search-engines (remove the catch-all robots.txt rule)

Make a .git page available for viewing all projects

Requirements

  • Usage of the GitHub provided api to add an option to showcase hit projects and make it available as a partial tht can be added onto any page
  • optional: add interface or block that allows users to add specific repositories as components to pages

JSON Generator

  • Write a generator to produce a merged JSON output of post URLs, titles and their description.

Add version number (-v) flag

A user may have an outdated binary on their system. Run a flag to print the current buildnumber / commit hash.

Cache Layouts

Cache the layout files used by anna to reduce the number of I/O operations during live reload

Clean up watcher.go

Clean up code from #18 linked to issue #3

  1. Move cobra to watcher.go or store the user mentioned flags somewhere accessible
  2. Optimize
  3. Make the watcher.go run when main.go is run, and make the main.go the main entry point for the ssg

Live reload

Reload after a directory file change event

CSS: mix themes

Experiment with multiple themes, using @import when using stylesheets

Hugo features

  • Hugo shortcodes
  • Create a new post with commands like anna --new post
  • Command like anna --migrate that adds anna specific requirements to user files while migrating from Hugo such as:
  1. Add the type: page/post field to the frontmatter of all 'md' files
  • Add drop-in support for simple Hugo themes (Long-term goal)

chore/ci: tag v1.0.0-alpha release and deploy matrix builds

Tag a v1.0.0-alpha release by wednesday, for the fireside talk. Ideally sign using our own GPG keys.
Use go-releaser and gh-actions to deploy matrix builds for 3 target platforms:

  • darwin (setup notarized builds)
  • Windows
  • GNU/linux

Should cover 3/4 of #65

Tests: Add tests and improve coverage

  • Write tests for various components of the ssg

    • tests for helper package
    • tests for engine package
    • tests for parser package
    • tests for the zettel feature
    • benchmark for main.go
  • Add status checks for PRs and fix netlify deploy preview

  • Minimum test coverage of 50% for all packages

    • Improve engine/ test coverage

chore/perf: bench.sh

A benchmark.sh shell-script to benchmark anna on a fresh machine

#!/bin/sh
echo "bash: clean dir"
cd /tmp; rm -rf bench; mkdir bench

echo "bash: installing hyperfine"
which hyperfine

echo "git: cloning ssgs"
git clone --depth=1 https://github.com/acmpesuecc/anna
git clone --depth=1 https://github.com/anirudhRowjee/saaru

echo "hyperfine: running bench"

TL;DR

qol: add commit SHA to anna footer

Use ${{ github.sha }} in the buildscript to have a version number or in this case SHA hash of the latest commit, used to build the page.

ref: Kinda like the Discord settings page

Partial_Screenshot_2024-03-09:00:04:44

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.