Extracts full page title and deletes all related meta tags.

 @return [String] page title.
553506
def extract_full_title
      site_title = extract(:site) || ''
      title      = extract_title || []
      separator  = extract_separator
      reverse    = extract(:reverse) == true

      TextNormalizer.normalize_title(site_title, title, separator, reverse)
    end
1303718
def pre_delete_title(instance, **kwargs):
    ''' 
    '''
    if instance.article.languages:
        languages = instance.article.languages.split(',')
    else:
        languages = []
    if instance.language in languages:
        languages.remove(instance.language)
        instance.article.languages = ','.join(languages)
        instance.article._publisher_keep_state = True
        instance.article.save(no_signals=True)
109360
def set_page
      title = params[:id] || params[:page_id] || params[:path]
      raise ActiveRecord::RecordNotFound, "Unknown page request" unless title

      @page = select_page(title)

      unless @page
        if user_can?(:create_page)
          return redirect_to new_page_path(title: title)
        else
          if title == "Home"
            @page = special_page("Welcome")
          else
            raise ActiveRecord::RecordNotFound, "Could not find page '#{title}'"
          end
        end
      end
    end
1314918
def content(self):
    '''
    
    '''

    if not getattr(self, '_content', False):
      query_params = {
        'prop': 'extracts|revisions',
        'explaintext': '',
        'rvprop': 'ids'
      }
      if not getattr(self, 'title', None) is None:
         query_params['titles'] = self.title
      else:
         query_params['pageids'] = self.pageid
      request = _wiki_request(query_params)
      self._content     = request['query']['pages'][self.pageid]['extract']
      self._revision_id = request['query']['pages'][self.pageid]['revisions'][0]['revid']
      self._parent_id   = request['query']['pages'][self.pageid]['revisions'][0]['parentid']

    return self._content
1064113
def all_h2
      result = []
      @pages.each do |page|
        result << [page.page_url, page.h2_text] unless page.page_a_tags
      end
      result
    end
1312319
private function getTitle(): string {
        $openGraph = $this->article()->getOpenGraph();

        // Rely on OpenGraph in case we have the data
        if (isset($openGraph['title'])) {
            return $this->cleanTitle($openGraph['title']);
        }

        $nodes = $this->getNodesByLowercasePropertyValue($this->article()->getDoc(), 'meta', 'name', 'headline');
        if ($nodes->count()) {
            return $this->cleanTitle($nodes->first()->attr('content'));
        }

        $nodes = $this->article()->getDoc()->find('html > head > title');
        if ($nodes->count()) {
            return $this->cleanTitle(Helper::textNormalise($nodes->first()->text()));
        }

        return '';
    }
220337
def _parse_title_url(html_chunk):
    
    url = None
    title_tags = html_chunk.match(
        ["div", {"class": "polozka_nazev"}],
        ["a", None, has_param("href")]
    )

    if not title_tags:
        return _parse_alt_title(html_chunk), _parse_alt_url(html_chunk)

    title = title_tags[0]

    url = normalize_url(BASE_URL, title.params["href"])
    title = title.getContent()

    if not title:
        title = _parse_alt_title(html_chunk)

    return title, url
364515
def show
      @first_page = true
      @article = Lines::Article.published.find(params[:id])
      @article.teaser = nil unless @article.teaser.present?
      meta_tags = { title: @article.title,
        type: 'article',
        url: url_for(@article),
        site_name: SITE_TITLE,
      }
      meta_tags[:image] = CONFIG[:host] + @article.image_url if @article.image_url.present?
      set_meta_tags title: @article.title,
                    keywords: KEYWORDS + @article.tag_list.to_s,
                    open_graph: meta_tags
      if request.path != article_path(@article)
        return redirect_to @article, status: :moved_permanently
      end

      @related_articles = Lines::Article.published.where('id != ?', @article.id).order('').limit(2)
    end
1042954
def title(controller_name, model_name = controller_name.singularize)
      string = ''
      unless ['page', 'routing_error', 'my_accounts'].include?(controller_name)
        string << t("activerecord.models.#{model_name}") + ' - '
      end
      if controller_name == 'routing_error'
        string << t("page.routing_error") + ' - '
      end
      string << LibraryGroup.system_name + ' - Next-L Enju Leaf'
      string.html_safe
    end
287217
function(body) {
    var $     = cheerio.load(body),
        page  = {};

    // Meta signals
    page.title = $('title').text() || null;
    page.description = $('meta[name=description]').attr('content') || null;
    page.author = $('meta[name=author]').attr('content') || null;
    page.keywords = $('meta[name=keywords]').attr('content') || null;

    // Heading signals
    var h1s = 0;
    $('h1').each(function() {
      h1s++;
    });
    page.heading1 = $('body h1:first-child').text().trim().replace('\n', '');
    page.totalHeadings = h1s;

    // Accessibility signals
    var totalImgs       = 0,
        accessibleImgs  = 0;
    $('img').each(function(index) {
      totalImgs++;
      if ($(this).attr('alt') || $(this).attr('title')) {
        accessibleImgs++;
      }
    });
    page.imgAccessibility = (accessibleImgs / totalImgs) * 100;
    return page;
  }
805037
def _parse_pages_binding(details):
    
    pages = _get_td_or_none(
        details,
        "ctl00_ContentPlaceHolder1_tblRowRozsahVazba"
    )

    if not pages:
        return None, None

    binding = None  # binding info and number of pages is stored in same string
    if "/" in pages:
        binding = pages.split("/")[1].strip()
        pages = pages.split("/")[0].strip()

    if not pages:
        pages = None

    return pages, binding
848336
def get_meta_headers

      headtags = ''

      # decide wether it is a page or it is a template displying other content i.e. the category page

      if !@content.nil?


        # if it has ACTUAL content then generate meta from the page content
        if !(@content.respond_to? :length)

          home_id = Setting.get('home_page')

          if @content.id == home_id.to_f
            # if it is the homepage create the meta tags manually
            headtags = get_manual_metadata 'home'
          else
            # use the page content to generate the meta data
            if @content.post_seo_is_disabled != 'Y'
              headtags = "#{get_page_title}\n"
              headtags += "#{get_meta_description}\n"
              headtags += "#{get_google_analytics}\n"
              headtags += "#{get_robots_tag}"
              headtags += "#{canonical_urls}"
            end
          end

          render :inline => headtags

        else

          url_arr = params[:slug].split('/') if !params[:slug].nil?

          # get generic variables
          article_url = Setting.get('articles_slug')
          category_url = Setting.get('category_slug')

          # if the url is equal to the article, category or archive area
          if (!url_arr.blank? && (url_arr.last == article_url || url_arr.last.match(/\A\+?\d+(?:\.\d+)?\Z/) || url_arr[1] == category_url))
            last_url = url_arr.last
            robots_var = nil

            if url_arr[0] == article_url || url_arr[1] == category_url
              robots_var = 'category'
            elsif last_url.match(/\A\+?\d+(?:\.\d+)?\Z/)
              robots_var = 'archive'
            end

            new_string = last_url.slice(0,1).capitalize + last_url.slice(1..-1)

            if last_url.match(/\A\+?\d+(?:\.\d+)?\Z/)
              if !url_arr[2].blank?

                new_string = Date::MONTHNAMES[url_arr[2].to_i]
                new_string = "#{new_string} #{url_arr[1]}"

                if !url_arr[3].blank?
                  new_string = "#{url_arr[3]} #{new_string}"
                end

              end
            end

            headtags = "#{get_page_title new_string}\n"
            headtags += "#{get_google_analytics}\n"
            headtags += "#{get_robots_tag robots_var}"

            render :inline => headtags

          end

        end

      else

        # render the 404 meta data
        headtags = response.status == 404 ? get_manual_metadata('404') : application_set_headers
        render :inline => headtags

      end

    end
357979
private String messagePageTitle() {

        return org.opencms.gwt.Messages.get().getBundle(getLocale()).key(
            org.opencms.gwt.Messages.GUI_DEPENDENCY_PAGE_TITLE_0);
    }
2810
def browser_title(yield_title = nil)
      [
        yield_title,
        @meta.browser_title.presence || @meta.path,
        Refinery::Core.site_name
      ].reject(&:blank?).join(" - ")
    end
865244
def heading_title(self):
        
        art_title = self.article.root.xpath('./front/article-meta/title-group/article-title')[0]
        article_title = deepcopy(art_title)
        article_title.tag = 'h1'
        article_title.attrib['id'] = 'title'
        article_title.attrib['class'] = 'article-title'
        return article_title
314389
def sitemap_meta_description
      return controller.sitemap_meta_data[:description].blank? ? nil : tag(:meta, {name: :description, content: controller.sitemap_meta_data[:description]}, false, false)
    end
374907
def render_title_tag(context, is_og=False):
    
    request = context['request']
    content = ''

    # Try to get the title from the context object (e.g. DetailViews).
    if context.get('object'):
        try:
            content = context['object'].get_meta_title()
        except AttributeError:
            pass
    elif context.get('meta_tagger'):
        content = context['meta_tagger'].get('title')

    if not content:
        # Try to get the title from the cms page.
        try:
            content = request.current_page.get_page_title()  # Try the `page_title` before the `title of the CMS page.
            if not content:
                content = request.current_page.get_title()
        except (AttributeError, NoReverseMatch):
            pass

    if not is_og:
        return content
    else:
        return mark_safe('<meta property="og:title" content="{content}">'.format(content=content))