pflag
Hugo
Our great sponsors
pflag | Hugo | |
---|---|---|
13 | 548 | |
2,293 | 71,964 | |
- | 1.3% | |
0.0 | 9.8 | |
18 days ago | 5 days ago | |
Go | Go | |
BSD 3-clause "New" or "Revised" License | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pflag
-
issue with pflag flagset
Just the bonus question: did I miss some hints when checking the https://github.com/spf13/pflag readme or the use case of FlagSet is indeed to just be used by cobra CLIs in subcommand only and not directly?
My understanding is that you can use pflag as a drop in replacement of the standard lib's flag (import flag "github.com/spf13/pflag"). So it can be used as a standalone lib I suppose.
-
Which packages do you recommend for building cli tools?
I realy enjoyed the patched version from spf13 with "--" support https://github.com/spf13/pflag
-
Define custom command-line flag types in Go 1.19
Nice, but Cobra (with pflag underneath) is so, so better.
-
-h --help -help help --? -? ????
Not by default on stdlib. There are libraries available though - https://github.com/spf13/pflag
-
Coral, a friendly Cobra fork with nearly all its features, but only 4 dependencies
Flag functionality is provided by the pflag library, a fork of the flag standard library which maintains the same interface while adding POSIX compliance.
-
The flag package: strange but good?
spf13 has a drop in pflag that does the - short and -- long flags.
-
What are your favorite packages to use?
oklog/ulid to generate IDs. coreos/go-oidc for validating JWTs I get from auth. google/go-cmp for comparing structs in tests (unless the project is already using Testify). spf13/pflag because life's too short for Go's flag handling. getkin/kin-openapi for validating reqests/responses against my OpenAPI spec (in tests).
-
akamensky/argparse: Argparse for Golang. Just because "flag" sucks!
What are the benefits of this package over the widely used spf13/pflag?
-
Go’s highly modular nature makes it particularly good for situations where requirements are changing or evolving.
3
Hugo
-
Creating excerpts in Astro
This blog is running on Hugo. It had previously been running on Jekyll. Both these SSGs ship with the ability to create excerpts from your markdown content in 1 line or thereabouts.
-
Craft Your GitHub Profile Page in 60 Seconds with Zero Code, Absolutely Free
Hugo
-
Top 5 Open-Source Documentation Development Platforms of 2024
Hugo is a popular static site generator specifically designed to create websites and documentation lightning-fast. Its minimalist approach, emphasis on speed, and ease of use have made it popular among developers, technical writers, and anybody looking to construct high-quality websites without the complexity of typical CMS platforms.
-
Ask HN: Looking for lightweight personal blogging platform
As per many other comments, it sounds like a static site generator like Hugo (https://gohugo.io/) or Jekyll (https://jekyllrb.com/), hosted on GitHub Pages (https://pages.github.com/) or GitLab Pages (https://about.gitlab.com/stages-devops-lifecycle/pages/), would be a good match. If you set up GitHub Actions or GitLab CI/CD to do the build and deploy (see e.g. https://gohugo.io/hosting-and-deployment/hosting-on-github/), your normal workflow will simply be to edit markdown and do a git push to make your changes live. There are a number of pre-built themes (e.g. https://themes.gohugo.io/) you can use, and these are realtively straightforward to tweak to your requirements.
-
Get People Interested in Contributing to Your Open Project
Create the technical documentation of your project You can use any of the following options: * A wiki, like the ArchWiki that uses MediaWiki * Read the Docs, used by projects like Setuptools. Check Awesome Read the Docs for more examples. * Create a website * Create a blog, like the documentation of Blowfish, a theme for Hugo.
-
Writing a SSG in Go
Doing this made me appreciate existing SSGs like Hugo and Next.js even more👏👏
-
Why Blogging Platforms Suck
I suggest hugo: https://gohugo.io/
Generates a completely static website from MD (and other formats) files; also handles themes (including a lot of them rendering well on mobile), and different types of content - posts, articles, etc. - depending on the theme.
It's open source and, being completely static, cheap as fuck to self host.
-
Any FOSS to make HTML websites for self-hosting?
I would suggest looking into static site generators. Some popular examples, which are used myself are: - Hugo: https://gohugo.io/ - Jekyll: https://jekyllrb.com
-
Hugo site generator theme in style of Jake's resume
I made a one-page theme for Hugo site generator that looks like Jake's resume. You can create resume page, deploy it on GitHub Pages and just print it to pdf file from browser for your needs afterwards. Demo page: https://schebotar.github.io/hugos-resume/ Repository: https://github.com/schebotar/hugos-resume
What are some alternatives?
astro - The web framework for content-driven websites. ⭐️ Star to support our work!
MkDocs - Project documentation with Markdown.
Pelican - Static site generator that supports Markdown and reST syntax. Powered by Python.
eleventy 🕚⚡️ - A simpler site generator. Transforms a directory of templates (of varying types) into HTML.
Hexo - A fast, simple & powerful blog framework, powered by Node.js.
obsidian-export - Rust library and CLI to export an Obsidian vault to regular Markdown
flag - Flag is a simple but powerful command line option parsing library for Go support infinite level subcommand
Jekyll - :globe_with_meridians: Jekyll is a blog-aware static site generator in Ruby
cobra - A Commander for modern Go CLI interactions
SvelteKit - web development, streamlined
Docusaurus - Easy to maintain open source documentation websites.
gutenberg - A fast static site generator in a single binary with everything built-in. https://www.getzola.org