Skip to content

Commit

Permalink
fix: don't use submodules
Browse files Browse the repository at this point in the history
Since we are adding files inside themes, don't use submodules
  • Loading branch information
ashishb committed Mar 24, 2024
1 parent f16cbf3 commit c14508b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/wp2hugo/internal/hugogenerator/hugo_gen_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ func (g Generator) setupHugo(outputDirPath string) (*string, error) {
fmt.Sprintf("hugo new site %s --format yaml", siteName),
"cd " + siteName,
"git init",
"git submodule add --depth=1 https://github.com/adityatelange/hugo-PaperMod.git themes/PaperMod",
"git submodule update --init --recursive",
"git clone https://github.com/adityatelange/hugo-PaperMod themes/PaperMod --depth=1",
`echo "theme: 'PaperMod'">> hugo.yaml`,
// Verify that the site is setup correctly
"hugo",
Expand Down
3 changes: 2 additions & 1 deletion src/wp2hugo/internal/hugogenerator/hugopage/hugo_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ func (page *Page) getMarkdown(provider ImageURLProvider, htmlContent string) (*s
return &markdown, nil
}

// Markdown converter will automatically pick up "class" attribute fromn "code" tag
// Ref: https://github.com/JohannesKaufmann/html-to-markdown/blob/master/commonmark.go#L334
func improvePreTagsWithCode(htmlContent string) string {
// Replace all occurrences of "data-enlighter-language" with "language"
// Ref: https://github.com/JohannesKaufmann/html-to-markdown/blob/master/commonmark.go#L334
if strings.Contains(htmlContent, "data-enlighter-language") {
htmlContent = strings.ReplaceAll(htmlContent, `data-enlighter-language="golang"`, `data-enlighter-language="go"`)
htmlContent = strings.ReplaceAll(htmlContent, `data-enlighter-language="shell"`, `data-enlighter-language="bash"`)
Expand Down

0 comments on commit c14508b

Please sign in to comment.