If you've forked the repo and set up your own thingoftheday microblog, I'd love to share it with the world! ✨ 😎
Find me on Twitter and say hello! 👋🏼
Contentful GraphiQL Playground:
https://graphql.contentful.com/content/v1/spaces/{YOUR_SPACE_ID}/explore?access_token={YOUR_ACCESS_TOKEN}
Follow this quick setup guide to get started in minutes!
We're going to make some small changes to some handy files in the ./setup
directory, and use the Contentful CLI to import the content model and example content provided into your own Contentful space.
Fork this repository to your GitHub account, and clone it to your local machine using git or the GitHub CLI.
Create your Contentful account. Sign up here.
- Create a new space inside your Contentful account
- Go to Settings > General Settings and make a note of the Space ID
- Go to Settings > API keys and generate an access token for the Content Delivery API
- Add your Space ID and access token to
./setup/credentials.js
Using homebrew:
brew install contentful-cli
Using npm:
npm install -g contentful-cli
Using yarn:
yarn global add contentful-cli
Run contentful login
in your terminal and follow the instructions in your browser.
Import the content model and example post to your Contentful space.
Access the Contentful CLI docs on importing/exporting data here.
Run the following command in your terminal, ensuring you switch out SPACE_ID for your new Space ID.
cd /path/to/repo/thingoftheday/setup
contentful space import --space-id SPACE_ID --content-file contentful-export.json
The terminal will do some fancy things. If all looks good - refresh Contentful in your browser and you'll find the content model and example post has been imported for you! 🎉🎉🎉
thingoftheday uses no frameworks and is powered by vanilla HTML, CSS and JavaScript!
To be able to serve the JS module to the browser, you'll need to serve the files over a local http server.
You can do this really nicely with this http-server package.
Install http-server globally, and start the development server locally by running:
cd path/to/repo
npx http-server
With your http server started, your credentials file configured, and your content model imported, you'll be able to visit your very own thingoftheday microblog in your browser - all within minutes.
Generate an RSS feed of the content by hitting the following url:
https://{hostname}/.netlify/functions/rss
The RSS feed for thingoftheday.xyz is available here.
And remember: