Replicating the Theme

You learned how to build a theme in this book, so you should have all of the tools you need to duplicate your existing theme, which is mostly a manual task. You’ll use hugo new theme to create a new theme, copy over your stylesheets and place them in the assets folder of your theme, create new partials, and create the appropriate templates for your content sections. Move over any tracking or analytics code you’ve integrated into your theme as well.

The basic theme you created in this book is a good starting point. Use that as the base and apply your changes over the top.

You might not be able to bring everything over from your old theme. Some platforms have additional features in their themes beyond colors and content placement. For example, WordPress sites often have an “archives” section where you can create pages that list posts by year and month. You might consider writing some code to generate those layout pages, or use the tagging approach used in Organizing Content with Taxonomies to build those pages.

In addition, your theme may have extra widgets you’re relying on, many written in a back-end programming language like PHP. If you’re moving your site, you’ll have to take inventory of those widgets, determine which ones you want to carry forward, and then decide on replacements. For instance, if you’re using a Twitter plugin to display your most recent tweets, you might consider using Twitter’s official JavaScript widget on your site.[64]

Your site is migrated, you’ve re-created your theme and tested everything; it’s time to cut over to the new site.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.254.94