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

[Feature]: Please add exception for Aside posts in WordPress blogs #120

Closed
codewizard13 opened this issue Feb 13, 2022 · 2 comments
Closed
Labels
enhancement New feature or request

Comments

@codewizard13
Copy link

Is your feature request related to a problem? Please describe.
I learned through this issue (#118) I posted yesterday that the action won't work on WordPress if any posts are missing a title tag. However, title tags are not necessary on custom post types like ASIDE, which is what the post on my blog was. Please add an exception for the "aside" post type in WordPress when checking for title tags.

Describe the solution you'd like
Here is PHP-ish pseudocode solution:

// Define exclusions
$exclusions = array('aside');

if ( in_array($this_post_type(), $exclusions ) ) {
   // don't cause title tag to fail ... maybe something like:
   $title = '';
} else {
   $title = $title;
}

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.

@codewizard13 codewizard13 added the enhancement New feature or request label Feb 13, 2022
@gautamkrishnar
Copy link
Owner

@codewizard13 How do you want the title to be displayed in your readme?

It will be shown just like this:

- [](http://example.com/)

preview:

When the title is empty

@gautamkrishnar
Copy link
Owner

@codewizard13 you can now use the following to disable validation:

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://erichepperle.com/category/programming-coding/feed"
          disable_item_validation: true

You can hide that item from the readme entirely via the following code:

name: Latest blog post workflow
on:
  schedule: # Run workflow automatically
    - cron: '0 * * * *' # Runs every hour, on the hour
  workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly

jobs:
  update-readme-with-blog:
    name: Update this repo's README with latest blog posts
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Pull in dev.to posts
        uses: gautamkrishnar/blog-post-workflow@master
        with:
          feed_list: "https://erichepperle.com/category/programming-coding/feed"
          disable_item_validation: true
          item_exec: |
                 if (!post.title) post = null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants