Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving html to index/block shortcodes #22169

Closed
wants to merge 7 commits into from
Closed

Conversation

premkumr
Copy link
Contributor

@premkumr premkumr commented Apr 26, 2024

Codemod commands

## image
codemod -m '<div class="col-12 col-md-6 col-lg-12 col-xl-6">[^>]*class="section-link icon-offset" href="([^"]*)">[^<]*<div class="head">\s*<img class="icon" src="([^"]*)"[^<]*<div class="title">([^<]*)</div>\s*</div>\s*<div class="body">\s*([^<]*)\n\s+</div>\s*</a>\s*</div>' '{{<index/item
    title="\3"
    body="\4"
    href="\1"
    icon="\2">}}' "$@"

## icon
codemod -m '<div class="col-12 col-md-6 col-lg-12 col-xl-6">[^>]*class="section-link icon-offset" href="([^"]*)">[^<]*<div class="head">\s*<div class="icon">\s*<i class="([^"]*)" *></i>\s*</div>[^<]*<div class="title">([^<]*)</div>\s*</div>\s*<div class="body">\s*([^<\n]*)\n\s+</div>\s*</a>\s*</div>' '{{<index/item
      title="\3"
      body="\4"
      href="\1"
      icon="\2" >}}' "$@"

# begin index block
codemod -m '<div class="row">\s*\n+( *)\{\{<index' '{{<index/block>}}\n\n\1 {{<index'

# end index block
codemod -m '(icon="[^<]+"\s*>\}\})\s*</div>' '\1\n\n{{</index/block>}}'

Miscellaneous

  • Some files had to be fixed manually

Copy link

netlify bot commented Apr 29, 2024

Deploy Preview for infallible-bardeen-164bc9 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9fa057b
🔍 Latest deploy log https://app.netlify.com/sites/infallible-bardeen-164bc9/deploys/662fdfdbf0abb70008f7b1b1
😎 Deploy Preview https://deploy-preview-22169--infallible-bardeen-164bc9.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ddhodge ddhodge added the area/documentation Documentation needed label Apr 29, 2024
@premkumr
Copy link
Contributor Author

Closing this as a duplicate of #22374

@premkumr premkumr closed this May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/documentation Documentation needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants