{"id":13618722,"url":"https://github.com/canhorn/Blazor.Contentful.Blog.Starter","last_synced_at":"2025-04-14T13:31:36.334Z","repository":{"id":47632286,"uuid":"369958753","full_name":"canhorn/Blazor.Contentful.Blog.Starter","owner":"canhorn","description":"A ASP.NET Core Blazor and Contentful blog site starter to get you up and running quickly with your new blog site.","archived":false,"fork":false,"pushed_at":"2023-08-03T12:48:52.000Z","size":1221,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T21:41:26.669Z","etag":null,"topics":["asp-net-core","azure","blazor","demo-site"],"latest_commit_sha":null,"homepage":"https://blazor-contentful-blog-starter.azurewebsites.net/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/canhorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-05-23T04:18:06.000Z","updated_at":"2024-05-27T09:50:03.000Z","dependencies_parsed_at":"2024-02-26T00:44:08.831Z","dependency_job_id":null,"html_url":"https://github.com/canhorn/Blazor.Contentful.Blog.Starter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canhorn%2FBlazor.Contentful.Blog.Starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canhorn%2FBlazor.Contentful.Blog.Starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canhorn%2FBlazor.Contentful.Blog.Starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/canhorn%2FBlazor.Contentful.Blog.Starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/canhorn","download_url":"https://codeload.github.com/canhorn/Blazor.Contentful.Blog.Starter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248888681,"owners_count":21178093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","azure","blazor","demo-site"],"created_at":"2024-08-01T21:00:29.621Z","updated_at":"2025-04-14T13:31:35.253Z","avatar_url":"https://github.com/canhorn.png","language":"C#","funding_links":[],"categories":[":star: Awesome Starters"],"sub_categories":[],"readme":"# Blazor + Contentful Blog Starter\n\n![A screenshot of the Next.js Contentful starter home page](screenshot.png)\n\nThis is an example repository for you to use to create a new blog site using Blazor and Contentful, using Contentful's .NET SDK.\n\n[Read more about the .NET SDK](https://www.contentful.com/developers/docs/net/).\n\n## View the demo site\n\n[Click here to explore the demo site that uses this repository as its source code.](https://blazor-contentful-blog-starter.azurewebsites.net/)\n\n## Deploy this site to Azure\n\nThe below Deploy to Azure will get you started with this template, when creating your instance you will need your Contentful API keys and Space Id, checkout the sections below to create them. After you can fill in your Contentful details and start the Creation.\nThere will be a little bit of a wait for the Azure Resources to be created and the initial build/deploy are done.\n\n[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fcanhorn%2FBlazor.Contentful.Blog.Starter%2Fmaster%2Fazure%2Fdeploy-to-azure.json)\n\n## Getting set up\n\nFork the repository to your GitHub account and clone it to your local machine.\n\n~~~bash\n#using git\ngit clone git@github.com:canhorn/Blazor.Contentful.Blog.Starter.git\n\n#using the GitHub CLI\ngh repo clone canhorn/Blazor.Contentful.Blog.Starter\n~~~\n\n## Configuring your development environment\n\n### Setup appsettings.json\n\nAt the root of the project, create a new `appsettings.Development.json` file. Add the following environment variable names to the file:\n\n~~~json\n{\n    \"ContentfulOptions\": {\n        \"DeliveryApiKey\": \"\u003cYour Deliver Api Key HERE\u003e\",\n        \"PreviewApiKey\": \"\u003cYour Preview Api Key HERE\u003e\",\n        \"SpaceId\": \"\u003cYour Space Id HERE\u003e\"\n    }\n}\n~~~\n\n### Using example content from Contentful\n\n**You will need to provided your own Contentful account.**\n\n### Creating your Contentful account\n\nTo get started with your own Contentful space, [sign up for free](https://www.contentful.com/sign-up/).\n\nCreate a new space inside your Contentful account. Go to Settings \u003e General Settings, and make a note of your space ID.\n\n![A screenshot of space ID settings in the Contentful UI](screenshot_space_id.png)\n\nGenerate a Content Delivery API access token for your Contentful space.\n\n![A screenshot of access token settings in the Contentful UI](screenshot_access_token.png)\n\nAdd your space ID and access token to your `appsettings.Development.json` file.\n\n## Importing the starter content model and example content into your own Contentful space\n\nTo get started quickly on your own version of the application, you can use the Contentful CLI to import the content model and the example content from the starter into your own Contentful space — without touching the Contentful UI!\n\n### Install the Contentful CLI\n\n~~~bash\n#using homebrew\nbrew install contentful-cli\n\n#using npm\nnpm install -g contentful-cli\n\n#using yarn\nyarn global add contentful-cli\n~~~\n\n### Authenticate with the CLI\n\nOpen a terminal and run:\n\n~~~bash\ncontentful login\n~~~\n\nA browser window will open. Follow the instructions to log in to Contentful via the CLI.\n\n### Import the content model and example content\n\nThe following command in your terminal, ensuring you switch out SPACE_ID for your new space ID.\n\n~~~bash\ncd Blazor.Contentful.Blog.Starter/Setup\n\ncontentful space import --space-id SPACE_ID --content-file content-export.json\n~~~\n\nYou should see this output in the terminal. The import will take around 1 minute to complete.\n\n![A screenshot of the import command running in a terminal](screenshot_import_terminal.png)\n\nRefresh Contentful in your browser, navigate to the content model tab, and you'll find the content types have been imported into your space. You'll find the example content by clicking on the content tab.\n\n![A screenshot of the imported content model in the Contentful UI](screenshot_content_model.png)\n\n## Running the application in development\n\nNavigate to the project directory in a terminal window and run:\n\n~~~bash\ndotnet watch run\n~~~\n\n## Cache Busting (WebHook registration)\n\nAfter your Azure instance, or other chosen deployment method, you will need to register a WebHook, ```https://\u003cyour-domain\u003e/webhook/cache-buster``` with Contentful. This WebHook is used by the Blazor Contentful Blog Starter application to know when it should clear its cache and request fresh CMS data from Contentful.\n\nI will not go over this process on this repository, but you can check [Intro to webhooks](https://www.contentful.com/developers/docs/concepts/webhooks) for more details.\n\n## Preview Environments\n\nWhen you want to preview unpublished work from Contentful you will have to set the  ```ContentfulOptions__UsePreviewApi``` app setting to ```true```. (example below) This will enable Preview Mode application wide, and API calls will pull in unpublished work. \n\nThis works great for creating a separate deployment website you can do work right no and when WebHooks are setup you will see the changes in realtime. If you use a local deployment and Ngrok to proxy the WebHook you can even develop new features!\n\n~~~ json\n{\n    \"ContentfulOptions\": {\n        \"DeliveryApiKey\": \"...\",\n        \"PreviewApiKey\": \"...\",\n        \"SpaceId\": \"...\",\n        \"UsePreviewApi\": true\n    }\n}\n~~~\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanhorn%2FBlazor.Contentful.Blog.Starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcanhorn%2FBlazor.Contentful.Blog.Starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcanhorn%2FBlazor.Contentful.Blog.Starter/lists"}