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

Add task(s) to visualize element and page usage #2496

Merged
merged 1 commit into from
Jul 3, 2023

Conversation

tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Jun 22, 2023

Adds two rake tasks

bin/rake alchemy:element_usage
bin/rake alchemy:page_usage

or short

bin/rake alchemy:usage

for a combined list for counts per element and page type.

Example from a real world site.

  Alchemy pages usage
  ----------------------

  11.749 𝗑 kiosk_article_page
  420 𝗑 landing_page
  354 𝗑 table_of_contents
  88 𝗑 product_landing_page
  54 𝗑 standard
  25 𝗑 years_issues
  11 𝗑 advertorial_article
  4 𝗑 main_navigation
  4 𝗑 advertorial
  3 𝗑 discount_quiz
  2 𝗑 footer
  2 𝗑 companies_page
  2 𝗑 top_bar
  2 𝗑 kiosk_standard
  2 𝗑 b1_footer
  2 𝗑 search
  2 𝗑 home
  1 𝗑 zukunftsabo
  1 𝗑 relaunch_home
  1 𝗑 safari_application
  1 𝗑 classified_page
  1 𝗑 global_navigation
  1 𝗑 contact_page
  1 𝗑 lottery_page
  1 𝗑 index
  1 𝗑 issue_archive_page

  = 12.735 pages in total.

  Alchemy elements usage
  ----------------------

  64.644 𝗑 textblock
  36.620 𝗑 paywall_product
  23.209 𝗑 opengraph_metatags
  22.849 𝗑 article_settings_elements
  22.839 𝗑 article_settings
  22.834 𝗑 article_intro
  21.389 𝗑 ihv_teaser
  19.105 𝗑 paywall
  17.542 𝗑 figure
  16.041 𝗑 pictures
  8.728 𝗑 info_box
  4.759 𝗑 picture
  4.624 𝗑 article_teaser
  4.128 𝗑 separator
  3.243 𝗑 multicolumn_wrapper
  3.114 𝗑 table
  2.911 𝗑 two_col_wrapper
  2.667 𝗑 world_in_figures
  2.512 𝗑 text
  1.606 𝗑 quote
  1.567 𝗑 container
  1.410 𝗑 twitter_card_metatags
  1.192 𝗑 page_intro_elements
  984 𝗑 image_gallery_picture
  927 𝗑 html_code
  707 𝗑 table_of_content_settings_elements
  705 𝗑 issue_teaser
  704 𝗑 table_of_content_settings
  680 𝗑 landingpage_intro
  474 𝗑 cta
  353 𝗑 video
  236 𝗑 image_gallery
  181 𝗑 page_intro
  143 𝗑 archive_teaser_item
  132 𝗑 page_title
  123 𝗑 big_picture
  89 𝗑 footer_menu_link
  88 𝗑 footer_navigation_link
  56 𝗑 flyout_teaser
  32 𝗑 main_nav_link
  32 𝗑 top_bar_meta_link
  31 𝗑 big_headline
  30 𝗑 top_bar_navigation_sub_link
  26 𝗑 archive_teaser_small
  22 𝗑 html
  22 𝗑 send_in_blue_newsletter
  21 𝗑 two_line_separator
  20 𝗑 top_bar_navigation_link
  20 𝗑 article_collection_item
  19 𝗑 send_in_blue_form
  18 𝗑 submenu
  18 𝗑 latest_taxon_products
  16 𝗑 footer_navigation
  15 𝗑 footer_menu
  14 𝗑 product_slide
  14 𝗑 separation_headline
  9 𝗑 image_text
  8 𝗑 lottery
  8 𝗑 link
  8 𝗑 headline
  8 𝗑 text_teaser
  7 𝗑 article_collection
  6 𝗑 magazin_teaser
  6 𝗑 product_teaser
  6 𝗑 safari_peergroup_date
  5 𝗑 banner
  4 𝗑 top_bar_meta
  4 𝗑 product_teasers
  4 𝗑 taxon_products
  4 𝗑 product_slider
  4 𝗑 top_bar_navigation
  3 𝗑 companies
  2 𝗑 safari_application_form
  2 𝗑 safari_peergroup
  2 𝗑 zukunftsabo
  2 𝗑 archive_teaser
  2 𝗑 slide
  2 𝗑 newsletter
  2 𝗑 ihv_audio_file
  2 𝗑 contact_form
  2 𝗑 classified_form
  1 𝗑 live_box
  1 𝗑 newsletter_subscription

  = 316.599 elements in total.

@tvdeyen tvdeyen requested a review from a team June 22, 2023 08:07
@tvdeyen tvdeyen force-pushed the usage-task branch 3 times, most recently from 117398e to 20b5655 Compare July 3, 2023 12:36
module Usage
extend self

def elements_count_by_name
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

res
end

def pages_count_by_type
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar blocks of code found in 2 locations. Consider refactoring.

@tvdeyen tvdeyen merged commit c239df1 into AlchemyCMS:main Jul 3, 2023
@tvdeyen tvdeyen deleted the usage-task branch July 3, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants