GithubHelp home page GithubHelp logo

ayushn21 / bridgetown-sitemap Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 4.0 305 KB

A Bridgetown plugin to generate a sitemap.xml

License: MIT License

Ruby 81.12% Liquid 0.27% HTML 14.48% Shell 4.13%
bridgetown-plugin bridgetown sitemap sitemap-generator sitemap-xml

bridgetown-sitemap's Introduction

Hey, I'm Ayush 👋

I'm a freelance web developer based in London, UK. I like boring tech like Ruby on Rails and the Hotwire approach to building websites.

I built and maintain a mailing list app called Scattergun. I'm also on the core team of the Bridgetown project.

My experience and portfolio is available on my website. I spout my opinions regularly on my blog.



I'm available for contract work and consulting in Ruby, Rails, static HTML websites and pretty much anything Web related. Drop me a line and let's chat!

bridgetown-sitemap's People

Contributors

ayushn21 avatar simonc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bridgetown-sitemap's Issues

Error: undefined method 'localtime' for #<Date ...>

When generating a sitemap it is possible for the following to occur

[Bridgetown] Exception raised: NoMethodError
[Bridgetown] undefined method `localtime' for #<Date: 2020-12-30 )> 

The reason is in sitemap.erb, #localtime is called on the return value of Bridgetown::Resource::Base#sitemap_last_modified_at ( resource.sitemap_last_modified_at.localtime.xmlschema ) but that method returns data.last_modified_at || latest_git_commit_date || date which can be a Date object, eg when the post front-matter includes date: 2020-12-30

Bridgetown v1.0.0.beta2 (codename "Pearl")

base.rb throws git errors when site is not in a git repo

I originally brought this up in bridgetownrb/bridgetown#490 but after some testing, was able to narrow it down to this plugin.

There are cases where a Bridgetown site may be deployed without existing in an active git repo (.git folder present), and as such, git commands will not work and throw errors. For sites with a lot of content, this creates a wall of git error noise.

https://github.com/ayushn21/bridgetown-sitemap/blob/main/lib/bridgetown/resource/base.rb#L12 - This logic should consider if git is available and if not, skip it.

Site with ~50 pages takes 20 seconds to generate sitemap

My site constantly takes 20 seconds to generate the XML feed. There are only about 50 pages and I don't think I'm doing anything crazy.

Codebase is open source, here: https://github.com/joemasilotti/masilotti.com

Recent server log when editing a file. Note how the site rebuilds in 0.01 seconds but the sitemap takes over 20.

[Bridgetown]          Reloading… 1 file changed at 2023-02-09 08:38:18
[Bridgetown]                     - src/_posts/2023-02-09-progressively-enhanced-turbo-native-apps-in-the-app-store.md
[Bridgetown]             Done! 🎉 Completed in less than 0.01 seconds.
[Bridgetown]
[Frontend] esbuild: frontend bundling started...
[Frontend] esbuild: frontend bundling complete!
[Frontend] esbuild: entrypoints processed:
[Frontend]          - index.QOLPUBLY.js: 487B
[Frontend]          - index.RPH5C6P5.css: 44.51KB
[Bridgetown]          Reloading… 1 file changed at 2023-02-09 08:38:19
[Bridgetown]                     - .bridgetown-cache/frontend-bundling/manifest.json
[Bridgetown]    Bridgetown Feed: Generating feed for hotwire
[Bridgetown]    Bridgetown Feed: Generating feed for posts
[Bridgetown]         Pagination: disabled. Enable in site config with pagination:\n enabled: true
[Bridgetown]             Done! 🎉 Completed in less than 20.37 seconds.
[Bridgetown]

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.